/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.sys.modular.sysappinfo.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import vip.xiaonuo.sys.core.msg.Result;
import vip.xiaonuo.sys.modular.sysappinfo.entity.SysAppInfo;
import vip.xiaonuo.sys.modular.sysappinfo.param.SysAppInfoParam;
import vip.xiaonuo.sys.modular.sysappinfo.service.SysAppInfoService;

import javax.annotation.Resource;
import java.util.List;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

/**
 * APP介绍详情控制器
 *
 * @author yanwei
 * @date 2023-03-21 12:07:25
 */
@RestController
@Api(tags = "后台管理 APP介绍详情 相关APIS")
@AdminVersionSwagger
public class SysAppInfoController {

    @Resource
    private SysAppInfoService sysAppInfoService;

    /**
     * 查询APP介绍详情
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfo/page")
    @BusinessLog(title = "APP介绍详情_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP介绍详情_查询")
    public Result<PageResult<SysAppInfo>> page(SysAppInfoParam sysAppInfoParam) {
        PageResult<SysAppInfo> page = sysAppInfoService.page(sysAppInfoParam);
        return success(page);
    }

    /**
     * 添加APP介绍详情
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfo/add")
    @BusinessLog(title = "APP介绍详情_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("APP介绍详情_增加")
    public Result add(@RequestBody @Validated(SysAppInfoParam.add.class) SysAppInfoParam sysAppInfoParam) {
            sysAppInfoService.add(sysAppInfoParam);
        return success();
    }

    /**
     * 删除APP介绍详情，可批量删除
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfo/delete")
    @BusinessLog(title = "APP介绍详情_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("APP介绍详情_删除")
    public Result delete(@RequestBody @Validated(SysAppInfoParam.delete.class) List<SysAppInfoParam> sysAppInfoParamList) {
            sysAppInfoService.delete(sysAppInfoParamList);
        return success();
    }

    /**
     * 编辑APP介绍详情
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfo/edit")
    @BusinessLog(title = "APP介绍详情_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("APP介绍详情_编辑")
    public Result edit(@RequestBody @Validated(SysAppInfoParam.edit.class) SysAppInfoParam sysAppInfoParam) {
            sysAppInfoService.edit(sysAppInfoParam);
        return success();
    }

    /**
     * 查看APP介绍详情
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfo/detail")
    @BusinessLog(title = "APP介绍详情_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("APP介绍详情_查看")
    public Result<SysAppInfo> detail(@Validated(SysAppInfoParam.detail.class) SysAppInfoParam sysAppInfoParam) {
        SysAppInfo detail =   sysAppInfoService.detail(sysAppInfoParam);
        return success(detail);
    }

    /**
     * APP介绍详情列表
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfo/list")
    @BusinessLog(title = "APP介绍详情_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP介绍详情_列表")
    public Result<List<SysAppInfo>> list(SysAppInfoParam sysAppInfoParam) {
        List<SysAppInfo> list  =   sysAppInfoService.list(sysAppInfoParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfo/export")
    @BusinessLog(title = "APP介绍详情_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("APP介绍详情_导出")
    public void export(SysAppInfoParam sysAppInfoParam) {
        sysAppInfoService.export(sysAppInfoParam);
    }

}
